// source --> https://www.marketingfocus.it/wp-content/plugins/chaty/js/cht-front-script.min.js?ver=3.0.61673518922 function launch_chaty(t){(void 0==t||"widget_index"==t)&&(t=1),jQuery("#chaty-widget-_"+t).length&&jQuery("#chaty-widget-_"+t+" .chaty-cta-button .open-chaty").trigger("click")}function close_chaty(){jQuery(".chaty.active .chaty-open").length&&jQuery(".chaty.active .chaty-open").each(function(){jQuery(this).find(".chaty-cta-close").trigger("click")})}!function(t){"use strict";"function"==typeof define&&define.amd?define(["jquery"],t):"undefined"!=typeof module&&module.exports?module.exports=t(require("jquery")):t(jQuery)}(function(t,a){var e,c,i=[],n="",s=/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|ipad|iris|kindle|Android|Silk|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(navigator.userAgent)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(navigator.userAgent.substr(0,4))?1:0,o=["System Stack","Arial","Tahoma","Verdana","Helvetica","Times New Roman","Trebuchet MS","Georgia","-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif"],h=!1,l=!1,r=0,d=!1,g=!1,y=[],p=0,f=0,v="",m=0;function u(e){if(a!=t("#chaty-widget-"+e).data("animation")&&"none"!=t("#chaty-widget-"+e).data("animation")){var c="chaty-animation-"+t("#chaty-widget-"+e).data("animation");t("#chaty-widget-"+e+" ."+c).removeClass(c)}}function w(){i.length&&(t.each(i,function(a,e){var c,h="",y="",p=0,f={},v=(c=e,!E(c.triggers.has_countries)||!!T(c.triggers.countries)||!c.triggers.countries.length||"-"==(n=q())||-1!=t.inArray(n,c.triggers.countries));if(v=(v=v&&function t(a){if(a.triggers.has_date_scheduling_rules){var e=a.triggers.date_scheduling_rules.start_date_time,c=a.triggers.date_scheduling_rules.end_date_time,i=new Date,n=(i=L(i,a.triggers.time_diff)).getFullYear()+"-"+W(i.getMonth()+1)+"-"+W(i.getDate())+" "+W(i.getHours())+":"+W(i.getMinutes())+":"+W(i.getSeconds());return""==c&&!!(e<=n)||""==e&&!!(c>=n)||""!=e&&""!=c&&!!(e<=n)&&!!(c>=n)}return!0}(e))&&function t(a){var e=!0;if(E(a.triggers.has_day_hours_scheduling_rules)&&a.triggers.day_hours_scheduling_rules.length>0){var c=a.triggers.day_hours_scheduling_rules;if(c.length>0){e=!1;for(var i=new Date,n=(i=L(i,a.triggers.day_time_diff)).getHours(),s=i.getMinutes(),o=i.getDay(),h=0;h=0&&c[h].days<=6?c[h].days==o&&(d=1):7==c[h].days?o>=0&&o<=4&&(d=1):8==c[h].days?o>=1&&o<=5&&(d=1):9==c[h].days&&(6==o||0==o)&&(d=1),1==d&&(n>c[h].start_hours&&n=c[h].start_min&&(l=1):n>c[h].start_hours&&n==c[h].end_hours?s<=c[h].end_min&&(l=1):n==c[h].start_hours&&n==c[h].end_hours&&s>=c[h].start_min&&s<=c[h].end_min&&(l=1),1==l&&s>=c[h].start_min&&s<=c[h].end_min&&(r=1)),1==l&&1==d&&(e=1),1==e&&(h=c.length+1)}}}return e}(e),t.each(e.channels,function(t,a){b(a)&&(p++,f=a)}),v&&p>0&&!t("#chaty-widget-"+e.id).length){var m,u=B(e.settings);u="right"==u?"right":"left";var w=(m=e,"vertical"!=m.settings.icon_view?"top":"right"==B(m.settings)?"left":"right");if("chat-view"==e.settings.cta_type){var x,C,S,j,M,z,A,U="";t("body").append(U),C=(x=e).id,null==(S=F(C))&&(S=-1),j=x.settings.cta_body,M=x.settings.cta_head,z=t("title").text(),T(z)?(j=j.replace(/{title}/g,""),M=M.replace(/{title}/g,"")):(j=j.replace(/{title}/g,z),M=M.replace(/{title}/g,z)),j=j.replace(/{url}/g,""+window.location.href+""),M=M.replace(/{url}/g,""+window.location.href+""),A="",A+="",t("#chaty-widget-"+C).append(A)}else{var U="";t("body").append(U)}E(e.triggers.auto_hide_widget)&&parseInt(e.triggers.hide_after)>0&&(t("#chaty-widget-"+e.id).addClass("auto-hide-chaty"),t("#chaty-widget-"+e.id).attr("data-time",e.triggers.hide_after));var O=D(e.id,"c-widget");if(t("#chaty-widget-"+e.id).addClass(e.settings.show_cta),1==p&&"chat-view"!=e.settings.cta_type){"vertical"!=e.settings.icon_view&&(w="right"!=u?"right":"left");var H=k(f,e.id,w);t("#chaty-widget-"+e.id+" .chaty-i-trigger").html(H),t("#chaty-widget-"+e.id+" .chaty-i-trigger").addClass("single-channel"),t("#chaty-widget-"+e.id+" .chaty-i-trigger .chaty-channel").addClass("single"),t("#chaty-widget-"+e.id+" .chaty-widget").addClass("has-single");var N=e.settings.cta_text;T(N)||(N=$(N)),"first_click"==e.settings.show_cta&&(O?(t("#chaty-widget-"+e.id+" .chaty-tooltip").removeClass("chaty-tooltip"),t("#chaty-widget-"+e.id+" .chaty-i-trigger .chaty-channel").addClass("active").addClass("chaty-tooltip").addClass("pos-"+w),t("#chaty-widget-"+e.id+" .chaty-i-trigger .chaty-channel").append(""+N+"").addClass("active").addClass("has-on-hover"),t("#chaty-widget-"+e.id+" .chaty-i-trigger .chaty-channel a").append(""+N+"").addClass("has-on-hover")):t("#chaty-widget-"+e.id+" .chaty-i-trigger .chaty-channel a").append(""+N+"").removeClass("active").addClass("has-on-hover")),"all_time"==e.settings.show_cta&&t("#chaty-widget-"+e.id+" .chaty-i-trigger .chaty-tooltip").append(""+N+"").addClass("active").addClass("has-on-hover");var G=f;("Instagram"!=G.channel_type||"#ffffff"!=G.icon_color&&"#fff"!=G.icon_color)&&(h+="#chaty-widget-"+e.id+" ."+G.channel_type+"-channel .color-element{ fill: "+G.icon_color+"; color: "+G.icon_color+";}",h+="#chaty-widget-"+e.id+" .channel-icon-"+G.channel_type+" .color-element{ fill: "+G.icon_color+"; color: "+G.icon_color+";}"),h+="#chaty-widget-"+e.id+" ."+G.channel_type+"-channel .chaty-custom-icon { background-color: "+G.icon_color+"; }",h+="#chaty-widget-"+e.id+" ."+G.channel_type+"-channel .chaty-svg { background-color: "+G.icon_color+";}",h+="#chaty-widget-"+e.id+" .channel-icon-"+G.channel_type+" .chaty-svg { background-color: "+G.icon_color+";}","Contact_Us"==G.channel_type&&(h+=".chaty-contact-form-box #chaty-submit-button-"+e.id+" {background-color: "+G.contact_form_settings.button_bg_color+"; color: "+G.contact_form_settings.button_text_color+";} ")}else{t.each(e.channels,function(a,c){if(b(c)){if(I(c.channel_type)&&(c.channel_type=c.channel),"chat-view"==e.settings.cta_type){var i=k(c,e.id,"top");t(".chaty-chat-view-"+e.id+" .chaty-view-channels").append(i)}else{var i=k(c,e.id,w);t("#chaty-widget-"+e.id+" .chaty-channel-list").append(i)}("Instagram"!=c.channel_type||"#ffffff"!=c.icon_color&&"#fff"!=c.icon_color)&&(h+="#chaty-widget-"+e.id+" ."+c.channel_type+"-channel .color-element{ fill: "+c.icon_color+"; color: "+c.icon_color+";}",h+="#chaty-widget-"+e.id+" .channel-icon-"+c.channel_type+" .color-element{ fill: "+c.icon_color+"; color: "+c.icon_color+";}"),h+="#chaty-widget-"+e.id+" ."+c.channel_type+"-channel .chaty-custom-icon { background-color: "+c.icon_color+"; }",h+="#chaty-widget-"+e.id+" ."+c.channel_type+"-channel .chaty-svg { background-color: "+c.icon_color+";}",h+="#chaty-widget-"+e.id+" .channel-icon-"+c.channel_type+" .chaty-svg { background-color: "+c.icon_color+";}",h+=".chaty-chat-view-"+e.id+" ."+c.channel_type+"-channel .chaty-custom-icon { background-color: "+c.icon_color+"; }",h+=".chaty-chat-view-"+e.id+" ."+c.channel_type+"-channel .chaty-svg { background-color: "+c.icon_color+";}",h+=".chaty-chat-view-"+e.id+" .channel-icon-"+c.channel_type+" .chaty-svg { background-color: "+c.icon_color+";}","Contact_Us"==c.channel_type&&(h+=".chaty-contact-form-box #chaty-submit-button-"+e.id+" {background-color: "+c.contact_form_settings.button_bg_color+"; color: "+c.contact_form_settings.button_text_color+";} ")}});var V,Y,R=(V=e.settings,Y=e.id,(""==V.widget_icon?V.widget_icon="chat-base":"chat-image"==V.widget_icon&&T(V.widget_icon_url)&&(V.widget_icon="chat-base"),"chat-image"==V.widget_icon)?"Chaty Widget":''+function t(a,e){switch(a){case"chat-smile":return'';case"chat-bubble":return'';case"chat-db":return'';default:return''}}(V.widget_icon,V.widget_color)+""),N=e.settings.cta_text;"first_click"!=e.settings.show_cta||O||(N="");var X=w;"horizontal"==e.settings.icon_view&&(X="left"==u?"right":"left"),T(N)||(N=$(N));var J='
'+N+'
';t("#chaty-widget-"+e.id+" .chaty-i-trigger").html(J);var Z='
';t("#chaty-widget-"+e.id+" .chaty-i-trigger").append(Z)}var Q,K,tt,ta,O=D(e.id,"c-widget");O&&("open"!=e.settings.default_state||1==p)&&(Q=e.settings,D(K=e.id,"c-widget")&&E(Q.is_pending_mesg_enabled)&&parseInt(Q.pending_mesg_count)>0&&(t("#chaty-widget-"+K+" .chaty-widget").hasClass("has-single")?"sheen"==Q.attention_effect||"spin"==Q.attention_effect||"pulse"==Q.attention_effect?t("#chaty-widget-"+K+" .chaty-i-trigger .chaty-channel").append(""+Q.pending_mesg_count+""):t("#chaty-widget-"+K+" .chaty-i-trigger .chaty-channel .chaty-svg").append(""+Q.pending_mesg_count+""):"jump"==Q.attention_effect||"waggle"==Q.attention_effect||"blink"==Q.attention_effect||"pulse-icon"==Q.attention_effect?t("#chaty-widget-"+K+" .chaty-i-trigger .chaty-cta-main .chaty-cta-button").append(""+Q.pending_mesg_count+""):t("#chaty-widget-"+K+" .chaty-i-trigger .chaty-cta-main").append(""+Q.pending_mesg_count+"")),tt=e.settings,D(ta=e.id,"c-widget")&&"none"!=tt.attention_effect&&""!=tt.attention_effect&&(t("#chaty-widget-"+ta).attr("data-animation",tt.attention_effect),t("#chaty-widget-"+ta+" .chaty-widget").hasClass("has-single")?t("#chaty-widget-"+ta+" .chaty-i-trigger .chaty-channel .chaty-svg").addClass("chaty-animation-"+tt.attention_effect):t("#chaty-widget-"+ta+" .chaty-i-trigger .chaty-cta-main .chaty-cta-button").addClass("chaty-animation-"+tt.attention_effect)));var te,tc,ti=0;"open"!=e.settings.default_state||E(e.settings.show_close_button)||(t("#chaty-widget-"+e.id+" .chaty-widget").addClass("chaty-no-close-button").addClass("chaty-open"),ti=1),E(e.settings.is_google_analytics_enabled)&&(t("#chaty-widget-"+e.id+" .chaty-channel-list .chaty-channel").addClass("has-gae"),t("#chaty-widget-"+e.id+" .chaty-i-trigger.single-channel .chaty-channel").addClass("has-gae"),t(".chaty-outer-forms.chaty-whatsapp-form.chaty-form-"+e.id+" form.add-analytics").addClass("form-google-analytics")),E(e.settings.has_custom_css)&&!T(e.settings.custom_css)&&(y+=e.settings.custom_css),"hover"==e.settings.default_state?t("#chaty-widget-"+e.id).addClass("open-on-hover"):"open"==e.settings.default_state&&(t("#chaty-widget-"+e.id+" .chaty-widget").addClass("default-open"),(O||!E(e.settings.show_close_button))&&t("#chaty-widget-"+e.id+" .chaty-widget").addClass("chaty-open"));var tn=(te=e.settings.widget_size,tc=e.settings.custom_widget_size,te);if(tn=parseInt(tn),h+="#chaty-widget-"+e.id+" .chaty-channel-list .chaty-channel {width: "+tn+"px; height: "+tn+"px; }",h+="#chaty-widget-"+e.id+" .chaty-channel-list .chaty-channel > a {width: "+tn+"px; height: "+tn+"px; }",h+="#chaty-widget-"+e.id+" .chaty-channel-list .chaty-channel > a .chaty-custom-icon {display:block; width: "+tn+"px; height: "+tn+"px; line-height: "+tn+"px; font-size: "+parseInt(tn/2)+"px; }",h+="#chaty-widget-"+e.id+" .chaty-channel-list .chaty-channel button {width: "+tn+"px; height: "+tn+"px; margin: 0; padding:0; outline: none; border-radius: 50%;}",h+="#chaty-widget-"+e.id+" .chaty-channel-list .chaty-channel .chaty-svg {width: "+tn+"px; height: "+tn+"px; }",h+="#chaty-widget-"+e.id+" .chaty-channel-list .chaty-channel .chaty-svg img {width: "+tn+"px; height: "+tn+"px; }",h+="#chaty-widget-"+e.id+" .chaty-channel-list .chaty-channel span.chaty-icon {width: "+tn+"px; height: "+tn+"px; }",h+="#chaty-widget-"+e.id+" .chaty-channel-list .chaty-channel a {width: "+tn+"px; height: "+tn+"px; }",h+="#chaty-widget-"+e.id+" .chaty-channel-list .chaty-channel .chaty-svg .chaty-custom-channel-icon {width: "+tn+"px; height: "+tn+"px; line-height: "+tn+"px; display: block; font-size:"+parseInt(tn/2)+"px; }",h+="#chaty-widget-"+e.id+" .chaty-i-trigger .chaty-cta-button {background-color: "+e.settings.widget_color+"; }",h+="#chaty-widget-"+e.id+" .chaty-i-trigger .chaty-cta-button button {background-color: "+e.settings.widget_color+"; }",h+="#chaty-widget-"+e.id+" .chaty-i-trigger .chaty-channel {width: "+tn+"px; height: "+tn+"px; }",h+="#chaty-widget-"+e.id+" .chaty-i-trigger .chaty-channel > a {width: "+tn+"px; height: "+tn+"px; }",h+="#chaty-widget-"+e.id+" .chaty-i-trigger .chaty-channel > a .chaty-custom-icon {display:block; width: "+tn+"px; height: "+tn+"px; line-height: "+tn+"px; font-size: "+parseInt(tn/2)+"px; }",h+="#chaty-widget-"+e.id+" .chaty-i-trigger .chaty-channel button {width: "+tn+"px; height: "+tn+"px; margin: 0; padding:0; outline: none; border-radius: 50%;}",h+="#chaty-widget-"+e.id+" .chaty-i-trigger .chaty-channel .chaty-svg {width: "+tn+"px; height: "+tn+"px; }",h+="#chaty-widget-"+e.id+" .chaty-i-trigger .chaty-channel .chaty-svg img {width: "+tn+"px; height: "+tn+"px; }",h+="#chaty-widget-"+e.id+" .chaty-i-trigger .chaty-channel span.chaty-icon {width: "+tn+"px; height: "+tn+"px; }",h+="#chaty-widget-"+e.id+" .chaty-i-trigger .chaty-channel a {width: "+tn+"px; height: "+tn+"px; }",h+="#chaty-widget-"+e.id+" .chaty-i-trigger .chaty-channel .chaty-svg .chaty-custom-channel-icon {width: "+tn+"px; height: "+tn+"px; line-height: "+tn+"px; display: block; font-size:"+parseInt(tn/2)+"px; }",h+="#chaty-widget-"+e.id+" .chaty-i-trigger .ch-pending-msg {background-color: "+e.settings.pending_mesg_count_bgcolor+"; color: "+e.settings.pending_mesg_count_color+"; }","vertical"==e.settings.icon_view){h+="#chaty-widget-"+e.id+" .chaty-channel-list {height: "+p*(tn+8)+"px; }",h+="#chaty-widget-"+e.id+" .chaty-channel-list {width: "+(tn+8)+"px; }";for(var ts=0;ts<=p;ts++)h+="#chaty-widget-"+e.id+" .chaty-open .chaty-channel-list .chaty-channel:nth-child("+(ts+1)+") {-webkit-transform: translateY(-"+(tn+8)*(p-ts-ti)+"px); transform: translateY(-"+(tn+8)*(p-ts-ti)+"px);}"}else{t("#chaty-widget-"+e.id+" .chaty-widget").addClass("hor-mode"),h+="#chaty-widget-"+e.id+" .chaty-channel-list {width: "+p*(tn+8)+"px; }",h+="#chaty-widget-"+e.id+" .chaty-channel-list {height: "+tn+"px; }";for(var ts=0;ts<=p;ts++)h+="#chaty-widget-"+e.id+" .chaty-widget.left-position.hor-mode.chaty-open .chaty-channel-list .chaty-channel:nth-child("+(ts+1)+") {-webkit-transform: translateX("+(tn+8)*(p-ts-ti)+"px); transform: translateX("+(tn+8)*(p-ts-ti)+"px);}",h+="#chaty-widget-"+e.id+" .chaty-widget.right-position.hor-mode.chaty-open .chaty-channel-list .chaty-channel:nth-child("+(ts+1)+") {-webkit-transform: translateX(-"+(tn+8)*(p-ts-ti)+"px); transform: translateX(-"+(tn+8)*(p-ts-ti)+"px);}"}var to=e.settings.bottom_spacing,th=e.settings.side_spacing;h+="#chaty-widget-"+e.id+" .chaty-widget {bottom: "+to+"px}","left"==u?(h+="#chaty-widget-"+e.id+" .chaty-widget {left: "+th+"px; right: auto;}",h+=".chaty-outer-forms.pos-left.chaty-form-"+e.id+" {left: "+th+"px}",t(".chaty-form-"+e.id).addClass("pos-left")):(h+="#chaty-widget-"+e.id+" .chaty-widget {right: "+th+"px; left:auto;}",t(".chaty-form-"+e.id).addClass("pos-right"),h+=".chaty-outer-forms.pos-right.chaty-form-"+e.id+" {right: "+th+"px; left:auto;}"),t(".chaty-form-"+e.id).show();var tl=tn+15+parseInt(to);h+=".chaty-outer-forms.active.chaty-form-"+e.id+" {-webkit-transform: translateY(-"+tl+"px); transform: translateY(-"+tl+"px)} ",h+="#chaty-widget-"+e.id+".chaty:not(.form-open) .chaty-widget.chaty-open + .chaty-chat-view {-webkit-transform: translateY(-"+tl+"px); transform: translateY(-"+tl+"px)} ",h+="#chaty-widget-"+e.id+" .chaty-tooltip:after {background-color: "+e.settings.cta_bg_color+"; color: "+e.settings.cta_text_color+"}",h+="#chaty-widget-"+e.id+" .chaty-tooltip.pos-top:before {border-top-color: "+e.settings.cta_bg_color+"; }",h+="#chaty-widget-"+e.id+" .chaty-tooltip.pos-left:before {border-left-color: "+e.settings.cta_bg_color+"; }",h+="#chaty-widget-"+e.id+" .chaty-tooltip.pos-right:before {border-right-color: "+e.settings.cta_bg_color+";}",h+="#chaty-widget-"+e.id+" .on-hover-text {background-color: "+e.settings.cta_bg_color+"; color: "+e.settings.cta_text_color+"}",h+="#chaty-widget-"+e.id+" .chaty-tooltip.pos-top .on-hover-text:before {border-top-color: "+e.settings.cta_bg_color+"; }",h+="#chaty-widget-"+e.id+" .chaty-tooltip.pos-left .on-hover-text:before {border-left-color: "+e.settings.cta_bg_color+"; }",h+="#chaty-widget-"+e.id+" .chaty-tooltip.pos-right .on-hover-text:before {border-right-color: "+e.settings.cta_bg_color+";}";var tr=tl+72+tn;tr>0&&(h+=".chaty-outer-forms.chaty-form-"+e.id+" .chaty-agent-body {max-height: calc(100vh - "+tr+"px); overflow-y: auto; } "),h+="#chaty-form-"+e.id+"-chaty-chat-view .chaty-view-header {background-color: "+e.settings.cta_head_bg_color+";}",h+="#chaty-form-"+e.id+"-chaty-chat-view .chaty-view-header {color: "+e.settings.cta_head_text_color+";}",h+="#chaty-form-"+e.id+"-chaty-chat-view .chaty-view-header svg {fill : "+e.settings.cta_head_text_color+";}";var td=tl+72+tn;td>0&&(h+=".chaty-outer-forms.chaty-whatsapp-form.chaty-form-"+e.id+" .chaty-whatsapp-content {max-height: calc(100vh - "+td+"px); overflow-y: auto; } ");var tg=tl+82+tn;if(tg>0&&(h+=".chaty-outer-forms.chaty-contact-form-box.chaty-form-"+e.id+" .chaty-contact-inputs {max-height: calc(100vh - "+tg+"px); overflow-y: auto; } "),(25!=to||25!=th)&&(t(".chaty-outer-forms.chaty-form-"+e.id).addClass("custom-cht-pos"),t("#chaty-widget-"+e.id).addClass("has-custom-pos")),D(e.id,"v-widget")&&(E(e.triggers.exit_intent)||E(e.triggers.has_time_delay)||E(e.triggers.has_display_after_page_scroll)>0)?(E(e.triggers.has_time_delay)&&0==parseInt(e.triggers.time_delay)?(_(e.id),t("#chaty-widget-"+e.id).addClass("active")):E(e.triggers.has_time_delay)&&parseInt(e.triggers.time_delay)>0&&(l=!0,parseInt(e.triggers.time_delay)>r&&(r=e.triggers.time_delay),t("#chaty-widget-"+e.id).addClass("on-chaty-delay"),t("#chaty-widget-"+e.id).addClass("delay-time-"+parseInt(e.triggers.time_delay)),t("#chaty-widget-"+e.id).attr("data-time",parseInt(e.triggers.time_delay))),E(e.triggers.has_display_after_page_scroll)&&0==parseInt(e.triggers.display_after_page_scroll)?(_(e.id),t("#chaty-widget-"+e.id).addClass("active")):E(e.triggers.has_display_after_page_scroll)&&parseInt(e.triggers.display_after_page_scroll)>0&&(d=!0,t("#chaty-widget-"+e.id).addClass("on-chaty-scroll"),t("#chaty-widget-"+e.id).addClass("page-scroll-"+parseInt(e.triggers.display_after_page_scroll)),t("#chaty-widget-"+e.id).attr("data-scroll",parseInt(e.triggers.display_after_page_scroll))),E(e.triggers.exit_intent)&&(g=!0,t("#chaty-widget-"+e.id).addClass("on-chaty-exit-intent"))):(_(e.id),t("#chaty-widget-"+e.id).addClass("active")),!T(e.settings.font_family)&&"none"!=e.settings.font_family){var ty=e.settings.font_family;-1!=t.inArray(ty,o)?"System Stack"==ty&&(ty="-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif"):(t("head").append(''),t("head").append('')),h+="#chaty-widget-"+e.id+", #chaty-widget-"+e.id+" .chaty-tooltip:after {font-family: "+ty+"}"}}g&&void(s?function a(){if(window.history&&window.history.pushState&&g){function e(){g&&""!==location.hash.split("#!/")[1]&&""===window.location.hash&&P()}var c=100;window.history.state&&window.history.state.page&&(c=window.history.state.page),window.history.pushState({page:c+1},""),window.history.pushState({page:c+2},""),window.onpopstate=function(){e()},window.history.onpopstate=function(){e()},window.addEventListener("popstate",function(){e()}),document.addEventListener("backbutton",function(){e()}),window.addEventListener("backbutton",function(){e()}),t(window).on("popstate",function(){e()})}}():t(document).mouseleave(function(t){var a,e,c="mouseout";a=document,e=function(t){null==t.toElement&&null==t.relatedTarget&&P()},a.addEventListener?(a.addEventListener(c,e,!1),P()):a.attachEvent&&a.attachEvent("on"+c,e)})),""!=h&&(t("#custom-chaty-css").length||t("head").append(""),t("#custom-chaty-css").append(h)),""!=y&&(t("#custom-advance-chaty-css").length||t("head").append(""),t("#custom-advance-chaty-css").append(y)),i.length}),t("#custom-advance-chaty-css").length||t("head").append(""),t("#custom-advance-chaty-css").append(v)),t(".chaty-tooltip").each(function(){""==t(this).data("hover")&&t(this).removeClass("left").removeClass("right").removeClass("top").removeClass("chaty-tooltip")}),t(".chaty.auto-hide-chaty").length&&(c=setInterval(function(){var a=++m;if(t(".chaty.auto-hide-chaty.hide-after-"+m).length){var e=t(".chaty.auto-hide-chaty.hide-after-"+a).data("id");t(".chaty-form-"+e).removeClass("active"),t(".chaty.auto-hide-chaty.hide-after-"+a).removeClass("active"),t("#chaty-widget-0"+e).removeClass("auto-hide-chaty")}0==t(".chaty.auto-hide-chaty").length&&clearInterval(c)},1e3)),l&&(e=setInterval(function(){if(t(".chaty.delay-time-"+ ++p).length){var a=t(".chaty.delay-time-"+p).data("id");U(a)}},1e3)),d&&(t(window).on("scroll",function(){if(d){var a=t(document).height()-t(window).height(),e=t(window).scrollTop();if(0!=a){var c=parseInt(e/a*100);if(f<=c){var i=f;f=c;for(var n=i;n<=c;n++)-1==t.inArray(n,y)&&t(".chaty.on-chaty-scroll.page-scroll-"+n).length&&t(".chaty.on-chaty-scroll.page-scroll-"+n).each(function(){var a=t(this).data("id");t(this).removeClass("on-chaty-scroll"),U(a)});f=c}}}}),window.innerWidth,document.documentElement.clientWidth)}function $(t){return new DOMParser().parseFromString(t,"text/html").documentElement.textContent}function b(t){if(E(t.is_agent)){if(t.agent_data.length&&(!s&&E(t.is_agent_desktop)||s&&E(t.is_agent_mobile)))return!0}else if((!s&&E(t.is_desktop)||s&&E(t.is_mobile))&&(""!=t.value||"Contact_Us"==t.channel))return!0;return!1}function _(a){if(t("#chaty-widget-"+a+" .chaty-channel.chaty-default-open").length){var e=t("#chaty-widget-"+a+" .chaty-channel.chaty-default-open a.chaty-whatsapp-form").data("form");if(!T(e)&&D(a,"c-"+t("#chaty-widget-"+a+" .chaty-channel.chaty-default-open").data("channel"))&&(t("#"+e).addClass("is-active"),t("#"+e).length)){var c=t("#chaty-widget-"+a+" .chaty-channel.chaty-default-open a.chaty-whatsapp-form").html();if(u(a),t("#chaty-widget-"+a).find(".ch-pending-msg").remove(),t("#chaty-widget-"+a+" .chaty-widget").removeClass("chaty-open"),t("#chaty-widget-"+a).addClass("form-open"),t("#"+e).addClass("active"),t("#chaty-widget-"+a+" .open-chaty-channel").html(c),t("#chaty-widget-"+a).addClass("active"),t("#chaty-widget-"+a).addClass("active"),t("#chaty-widget-"+a).hasClass("auto-hide-chaty")){var n=parseInt(t("#chaty-widget-"+a).data("time"));n>0&&(n+=m,t("#chaty-widget-"+a).addClass("hide-after-"+n))}if("on"==chaty_settings.data_analytics_settings){var o=[],l=t("#chaty-widget-"+a+" .chaty-channel.chaty-default-open").data("channel"),r=D(a,"v-"+l);if(r&&void 0!==l&&(O(a,"v-"+l),o.push(l)),!h&&o.length){var d=t("#chaty-widget-"+a).data("nonce");t.ajax({url:chaty_settings.ajax_url,data:{widgetId:a,channels:o,userId:a,isMobile:s,widgetNonce:d,action:"update_chaty_channel_views"},type:"post",success:function(t){},error:function(t,a,e){monitorErrorLog(t,a,e)}})}}return}}if(t("#chaty-widget-"+a).addClass("active"),t("#chaty-widget-"+a).hasClass("auto-hide-chaty")){var n=parseInt(t("#chaty-widget-"+a).data("time"));n>0&&(n+=m,t("#chaty-widget-"+a).addClass("hide-after-"+n))}var g=D(a,"v-widget");if(g){O(a,"v-widget"),t("#chaty-widget-"+a).data("user");var l,o=[],y=0,p=0;i[t("#chaty-widget-"+a).data("key")];var f=N("activechatyWidgets");if(null!=f?(f=f.split(","),-1==t.inArray(a,f)&&(f.push(a),H("activechatyWidgets",f=f.join(","),1))):(f=a,H("activechatyWidgets",f,1)),t("#chaty-widget-"+a+" .chaty-widget").hasClass("has-single")){y=1,l=t("#chaty-widget-"+a+" .chaty-channel").data("channel");var r=D(a,"v-"+l);r&&void 0!==l&&(O(a,"v-"+l),o.push(l))}else t("#chaty-widget-"+a+" .chaty-widget").hasClass("chaty-open")&&(p=1,t("#chaty-widget-"+a+" .chaty-channel-list .chaty-channel").each(function(){l=t(this).data("channel"),D(a,"v-"+l)&&void 0!==l&&(O(a,"v-"+l),o.push(l))}));if(g&&!h){var d=t("#chaty-widget-"+a).data("nonce");h||t.ajax({url:chaty_settings.ajax_url,data:{widgetId:a,channels:o,userId:a,isMobile:s,isOpen:p,isSingle:y,widgetNonce:d,action:"update_chaty_widget_views"},type:"post",success:function(t){},error:function(t,a,e){monitorErrorLog(t,a,e)}})}}}function x(a){var e=t("#chaty-widget-"+a).data("user");chatySaasCheckCookie("triggeredFor"+e)||H("triggeredFor"+e,a,2)}function C(t,a){return t}function k(a,e,c){var i="";if(E(a.is_agent)){if(a.agent_data.length){var n=0,o=[];if(t.each(a.agent_data,function(t,a){""!=a.value&&(n++,o=a)}),n>0){var h,l,r,d,g,y,p=F(e);return null==p&&(p=-1),r=a,d=e,g="",null==(y=F(d))&&(y=-1),g+="",v+=".chaty-agent-header.agent-info-"+d+"-"+r.channel+" { background-color: "+r.header_bg_color+"; color: "+r.header_text_color+" } ",v+=".agent-info-"+d+"-"+r.channel+" .chaty-close-agent-list svg { fill: "+r.header_text_color+" } ",t("body").append(g),h=A(a,e),l=z(a,h,c,e),("Instagram"!=a.channel||"#ffffff"!=a.icon_color&&"#fff"!=a.icon_color)&&(v+=".chaty-agent-"+e+"-"+a.channel+" .color-element {fill: "+a.icon_color+"; color: "+a.icon_color+";}"),v+=".chaty-agent-"+e+"-"+a.channel+" .chaty-custom-icon { background-color: "+a.icon_color+";}",v+=".chaty-agent-"+e+"-"+a.channel+" .chaty-svg-img { background-color: "+a.icon_color+";}","
"+l+"
"}}}else{I(a.channel_type)&&(a.channel_type=a.channel);var h=A(a,e),l=z(a,h,c,e);return"Contact_Us"==a.channel_type?i+=" has-chaty-box chaty-contact-form":"Whatsapp"==a.channel_type&&E(a.has_welcome_message)&&!T(a.chat_welcome_message)&&E(a.is_default_open)&&D(e,"c-"+a.channel_type)&&(i+=" chaty-default-open"),"
"+l+"
"}}function S(a,e,c,i,n){var o=e.value,h="_blank";if("Whatsapp"==a.channel_type){var l=j(e.value);s?(h="",o="https://wa.me/"+l):(h="_blank",o="https://web.whatsapp.com/send?phone="+l)}else"WeChat"==a.channel_type?(h="",o="javascript:;"):"Email"==a.channel_type?(h="",o="mailto:"+e.value):"Facebook_Messenger"==a.channel_type?h=s?"":"_blank":"SMS"==a.channel_type?(h="",o="sms:"+e.value):"Telegram"==a.channel_type?(o="https://telegram.me/"+(o=M(e.value,"@")),h="_blank"):"Twitter"==a.channel_type?o="https://twitter.com/"+t.trim(e.value):"Phone"==a.channel_type?(h="",o="tel:"+t.trim(e.value)):"Skype"==a.channel_type?(h="",o="skype:"+t.trim(e.value)+"?chat"):"Snapchat"==a.channel_type?o="https://www.snapchat.com/add/"+t.trim(e.value):"Vkontakte"==a.channel_type?o="https://vk.me/"+t.trim(e.value):"Linkedin"==a.channel_type?o="personal"==e.link_type?"https://www.linkedin.com/in/"+t.trim(e.value):"https://www.linkedin.com/company/"+t.trim(e.value):"Viber"==a.channel_type?(isNaN(o=M(e.value,"+"))||(o=o.replace("+",""),navigator.userAgent.match(/(iPod|iPhone|iPad)/)&&(o="+"+o),o="viber://chat?number="+o),h=""):"TikTok"==a.channel_type&&(o="https://www.tiktok.com/@"+(o=M(t.trim(e.value),"@")),h="");return""+i+""}function j(t){return t=(t=(t=(t=M(t,"+")).replace(/ /g,"")).replace(/-/g,"")).replace(/_/g,"")}function M(a,e){for(a=t.trim(a);a.charAt(0)==e;)a=a.substring(1);for(;a.charAt(a.length-1)==e;)a=a.substring(0,a.length-1);return a}function z(a,e,c,i){var n,o,h,l,r,d,g,y,p="";if(E(a.is_agent))a.url="javascript:;",a.target="";else if("Whatsapp"==a.channel_type){if(E(a.has_welcome_message)&&!T(a.chat_welcome_message))a.url="javascript:;",a.target="",p+=" has-chaty-box chaty-whatsapp-form",function a(e,c){var i="",n=F(c);null==n&&(n=-1);var o="https://web.whatsapp.com/send",h="";if(s?o="https://wa.me/"+e.value:(o=E(e.is_use_web_version)?"https://web.whatsapp.com/send":"https://wa.me/"+e.value,h="_blank"),i+="",t("body").append(i),t("#chaty-form-"+c+"-"+e.channel_type+" .chaty-whatsapp-message").html(e.chat_welcome_message),!T(e.pre_set_message)){var l=e.pre_set_message,r=t("title").text();l=(l=T(r)?l.replace(/{title}/g,""):l.replace(/{title}/g,r)).replace(/{url}/g,window.location),t("#chaty-form-"+c+"-"+e.channel_type+" .csass-whatsapp-input").val(l)}t("#chaty-form-"+c+"-"+e.channel_type).show()}(a,i);else{var f="";if(!T(a.pre_set_message)){f=decodeURI(a.pre_set_message);var v=t("title").text();f=(f=T(v)?f.replace(/{title}/g,""):f.replace(/{title}/g,v)).replace(/{url}/g,window.location),f=encodeURIComponent(f)}s?(a.target="",a.url="https://wa.me/"+a.value+"?text="+f):(a.target="_blank",E(a.is_use_web_version)?a.url="https://wa.me/"+a.value+"?text="+f:a.url="https://web.whatsapp.com/?phone="+a.value+"&text="+f)}}else if("WeChat"==a.channel_type){T(a.qr_code_image_url)||(n=a,h="",null==(l=F(o=i))&&(l=-1),h+="",t("body").append(h),a.url="javascript:;",a.target="",p+=" has-chaty-box chaty-qr-code-form")}else if("Contact_Us"==a.channel_type){r=a,g="",null==(y=F(d=i))&&(y=-1),g+="",t("body").append(g),a.url="javascript:;",a.target="",p+=" has-chaty-box chaty-contact-us-form"}else if("Email"==a.channel_type){if(!T(a.mail_subject)){var m=decodeURI(a.mail_subject),v=t("title").text();m=(m=T(v)?m.replace(/{title}/g,""):m.replace(/{title}/g,v)).replace(/{url}/g,window.location),m=encodeURIComponent(m),a.url+="?subject="+m}}else"Viber"==a.channel_type?(a.value=M(a.value,"+"),s&&!isNaN(a.value)&&navigator.userAgent.match(/(iPod|iPhone|iPad)/)&&(a.value="+"+a.value),a.url="viber://chat?number="+a.value,a.target=""):"Vkontakte"==a.channel_type&&(a.url="https://vk.me/"+t.trim(a.value));var u="";return T(a.click_event)||(u='onclick="'+a.click_event+'"',a.target="",a.url="javascript:;"),""+e+""}function $(t){return new DOMParser().parseFromString(t,"text/html").documentElement.textContent}function F(a){var e=null;return i.length&&t.each(i,function(t,c){c.id==a&&(e=t)}),e}function T(a){return null==a||""==a||""==t.trim(a)}function A(t){return""!=t.custom_image_url&&"null"!=t.custom_image_url?""+t.hover_text+"":""+t.svg_icon+""}function I(a){return""==a||""==t.trim(a)||null==a||"null"==a}function B(t){return"custom"==t.position?t.custom_position:t.position}function P(){g&&t(".on-chaty-exit-intent").length&&t(".on-chaty-exit-intent").each(function(){var a=t(this).data("id");t(this).removeClass("on-chaty-exit-intent"),U(a),t("#chaty-widget-"+a+" .chaty-widget").append("
"),setTimeout(function(){t(".chaty-exit-intent").addClass("animate"),setTimeout(function(){t(".chaty-exit-intent").removeClass("animate")},2500)},500)})}function U(a){_(a),t(".chaty-widget-"+a).removeClass("on-chaty-delay"),t(".chaty-widget-"+a).removeClass("on-chaty-exit-intent"),t(".chaty-widget-"+a).removeClass("on-chaty-scroll"),t(".chaty.on-chaty-delay").length||(clearInterval(e),l=!1),t(".chaty.on-chaty-exit-intent").length||(g=!1),t(".chaty.on-chaty-scroll").length||(d=!1)}function W(t){for(t=t.toString();t.length<2;)t="0"+t;return t}function E(t){return"1"==t||1==t||!0==t||"true"==t||"yes"==t||"on"==t}function L(t,a){if(isNaN(a)){var e=new Date(t.toLocaleString("en-US",{timeZone:a})),c=t.getTime()-e.getTime();return new Date(t.getTime()-c)}var i=new Date;if(i=i.toLocaleString("en-US",{timeZone:"UTC"}),i=new Date(i),-1!=a.indexOf("+")){var n=a.replace("+",""),s=parseInt(n),o=60*parseFloat(n%s);(o=i.getUTCMinutes()+o)>59&&(s+=parseInt(o/60),o%=60),i.setUTCHours(i.getUTCHours()+s,o)}else if(-1!=a.indexOf("-")){var n=a.replace("-",""),s=parseInt(n),o=60*parseFloat(n%s);(o=i.getUTCMinutes()-o)<0&&(s-=parseInt(o/60),o%=60),i.setUTCHours(i.getUTCHours()-s,-o)}var c=t.getTime()-i.getTime();return new Date(t.getTime()-c)}function q(){return n="","undefined"!=typeof Storage&&null!=window.sessionStorage.getItem("chaty_user_country_code")?n=window.sessionStorage.getItem("chaty_user_country_code"):G("chaty_user_country_code")&&(n=N("chaty_user_country_code")),n}function O(t,a){var e=N("chatyWidget_"+t),c=[];null!=e&&""!=e&&(c=JSON.parse(e));var i=!1;if(c.length>0)for(var n=0;n0){for(var n=0;n=2))return!1}return!0}function H(t,a,e){var c=new Date;c.setTime(c.getTime()+864e5*e);var i="expires="+c.toUTCString();document.cookie=t+"="+a+"; "+i+"; path=/; SameSite=Lax"}function N(t){for(var t=t+"=",a=document.cookie.split(";"),e=0;e1&&(e=e[1])&&(""==(e=e.toUpperCase())&&(e="-"),a=e,"undefined"!=typeof Storage?null==window.sessionStorage.getItem("chaty_user_country_code")&&window.sessionStorage.setItem("chaty_user_country_code",a):G("chaty_user_country_code")||H("chaty_user_country_code",a,365),w())}):w()),t(window).height()>t(window).width()?t("body").addClass("cht-portrait").removeClass("cht-landscape"):t("body").addClass("cht-landscape").removeClass("cht-portrait"),t(document).on("click","html, body",function(a){t(".form-open").removeClass("form-open"),t(".chaty-outer-forms").removeClass("active"),t(".chaty .chaty-widget.chaty-no-close-button").addClass("chaty-open")}),t(document).on("click",".chaty, .chaty-outer-forms",function(t){t.stopPropagation()}),t(document).on("click",".chaty-close-view-list",function(){t(this).closest(".chaty").find(".chaty-widget").removeClass("chaty-open")}),t(document).on("submit",".whatsapp-chaty-form",function(){if(t(this).hasClass("form-google-analytics")){var a="Whatsapp";if(window.hasOwnProperty("gtag")&>ag("event","chaty_"+a,{eventCategory:"chaty_"+a,event_action:"chaty_"+a,method:"chaty_"+a}),window.hasOwnProperty("ga")){var e=window.ga.getAll()[0];e&&e.send("event","click",{eventCategory:"chaty_"+a,eventAction:"chaty_"+a,method:"chaty_"+a})}}var c=t(this).data("widget"),i=t(this).data("channel"),n=D(c,"c-"+i);if((!T(c)||0==c)&&n){O(c,"c-"+i);var o=t("#chaty-widget-"+c).data("nonce");h||t.ajax({url:chaty_settings.ajax_url,data:{widgetId:c,userId:c,isMobile:s,channel:i,nonce:o,action:"update_chaty_channel_click"},method:"post"})}t("#chaty-widget-"+c).length&&(t("#chaty-widget-"+c).removeClass("form-open"),t(this).closest(".chaty-outer-forms").removeClass("active"),t("#chaty-widget-"+c).find(".chaty-widget").hasClass("cssas-no-close-button")&&t("#chaty-widget-"+c).find(".chaty-widget").addClass("chaty-open"))}),t(document).on("click",".chaty-close-button, .chaty-close-agent-list",function(a){a.preventDefault(),a.stopPropagation();var e=t(this).closest(".chaty-outer-forms").data("widget");if((!T(e)||0==e)&&(t("#chaty-widget-"+e).length&&(t("#chaty-widget-"+e).removeClass("form-open"),t(this).closest(".chaty-outer-forms").removeClass("active"),t("#chaty-widget-"+e).find(".chaty-widget").hasClass("chaty-no-close-button")&&t("#chaty-widget-"+e).find(".chaty-widget").addClass("chaty-open")),t(this).closest(".chaty-whatsapp-form").length)){var c=t(this).closest(".chaty-outer-forms").data("channel");!T(c)&&D(e,"c-"+c)&&O(e,"c-"+c),D(e,"v-widget")&&_(e)}}),t(document).on("click","a.chaty-qr-code-form",function(a){a.preventDefault();var e=t(this).data("form");if(!T(e)&&t("#"+e).length){var c=t(this).html();t("#"+e).hasClass("active")?(t(this).closest(".chaty").find(".chaty-widget").addClass("chaty-open"),t(this).closest(".chaty").removeClass("form-open"),t("#"+e).removeClass("active")):(t(this).closest(".chaty").find(".chaty-widget").removeClass("chaty-open"),t(this).closest(".chaty").addClass("form-open"),t("#"+e).addClass("active"),t(this).closest(".chaty").find(".open-chaty-channel").html(c))}}),t(document).on("click","a.chaty-contact-us-form",function(a){a.preventDefault();var e=t(this).data("form");if(!T(e)&&t("#"+e).length){var c=t(this).html();t("#"+e).hasClass("active")?(t(this).closest(".chaty").find(".chaty-widget").addClass("chaty-open"),t(this).closest(".chaty").removeClass("form-open"),t("#"+e).removeClass("active")):(t(this).closest(".chaty").find(".chaty-widget").removeClass("chaty-open"),t(this).closest(".chaty").addClass("form-open"),t("#"+e).addClass("active"),t("#"+e).find(".chaty-ajax-success-message").remove(),t("#"+e).find(".chaty-ajax-error-message").remove(),t("#"+e).find(".has-chaty-error").removeClass("has-chaty-error"),t(this).closest(".chaty").find(".open-chaty-channel").html(c))}}),t(document).on("click","a.chaty-whatsapp-form",function(a){a.preventDefault();var e=t(this).data("form");if(!T(e)&&t("#"+e).length){var c=t(this).html();t("#"+e).addClass("is-active"),t("#"+e).hasClass("active")?(t(this).closest(".chaty").find(".chaty-widget").addClass("chaty-open"),t(this).closest(".chaty").removeClass("form-open"),t("#"+e).removeClass("active")):(t(this).closest(".chaty").find(".chaty-widget").removeClass("chaty-open"),t(this).closest(".chaty").addClass("form-open"),t("#"+e).addClass("active"),t(this).closest(".chaty").find(".chaty-widget").find(".open-chaty-channel").html(c))}}),t(document).on("click",".chaty-channel.chaty-agent-button",function(a){a.preventDefault();var e=t(this).data("form");if(!T(e)&&t("#"+e).length){if(t(this).closest(".chaty").find(".chaty-widget").hasClass("has-single")){if(t(this).closest(".chaty").hasClass("form-open"))t(this).closest(".chaty").find(".chaty-widget").addClass("chaty-open"),t(this).closest(".chaty").removeClass("form-open"),t("#"+e).removeClass("active");else{var c=t(this).html();t("#"+e).addClass("is-active"),t(this).closest(".chaty").find(".chaty-widget").removeClass("chaty-open"),t(this).closest(".chaty").addClass("form-open"),t("#"+e).addClass("active"),t(this).closest(".chaty").find(".open-chaty-channel").html(c)}}else{var c=t(this).html();t("#"+e).addClass("is-active"),t(this).closest(".chaty").find(".chaty-widget").removeClass("chaty-open"),t(this).closest(".chaty").addClass("form-open"),t("#"+e).addClass("active"),t(this).closest(".chaty").find(".open-chaty-channel").html(c)}}}),t(document).on("click",".chaty-channel.has-gae",function(e){e.stopPropagation();var c=t(this).data("channel");if(c!==a&&""!=c&&null!=c&&(window.hasOwnProperty("gtag")&>ag("event","chaty_"+c,{eventCategory:"chaty_"+c,event_action:"chaty_"+c,method:"chaty_"+c}),window.hasOwnProperty("ga"))){var i=window.ga.getAll()[0];i&&i.send("event","click",{eventCategory:"chaty_"+c,eventAction:"chaty_"+c,method:"chaty_"+c})}}),t(document).on("click",".chaty-i-trigger:not(.single-channel)",function(){t(this).closest(".chaty").hasClass("form-open")?(t(this).closest(".chaty").removeClass("form-open"),t(this).closest(".chaty-widget").addClass("chaty-open")):t(this).closest(".chaty-widget").toggleClass("chaty-open"),t(".chaty-outer-forms.active").each(function(){t(this).removeClass("active");var a=t(this).data("widget");t("#chaty-widget-"+a).removeClass("form-open")}),t(this).closest(".chaty").find(".chaty-widget").hasClass("chaty-no-close-button")&&t(this).closest(".chaty").find(".chaty-widget").addClass("chaty-open")}),s||t(document).on("mouseover","body:not(.chaty-in-mobile) .chaty.open-on-hover .chaty-i-trigger:not(.single-channel)",function(){t(this).closest(".chaty-widget").hasClass("chaty-open")||t(this).closest(".chaty-widget").hasClass("on-chaty-widget")||(t(this).closest(".chaty-widget").addClass("on-chaty-widget"),t(this).find(".chaty-cta-main").trigger("click"))}).on("mouseleave","body:not(.chaty-in-mobile) .chaty.open-on-hover .chaty-i-trigger:not(.single-channel)",function(){t(this).closest(".chaty-widget").hasClass("chaty-open")||t(this).closest(".chaty-widget").removeClass("on-chaty-widget")}),t(document).on("click",".chaty-channel.single a",function(){if(t(this).closest(".chaty").hasClass("first_click")){var a=t(this).closest(".chaty").data("id");O(a,"c-widget"),t(this).closest(".chaty-channel").removeClass("active")}}),t(document).on("click",".chaty-channel",function(a){var e,c,i,n=[],o=0,l=t(this).closest(".chaty").data("id");if(void 0!==l&&void 0!==(i=t("#chaty-widget-"+l).data("identifier"))){var r=t("#chaty-widget-"+l).data("user");if(u(l),t(this).hasClass("chaty-cta-main")||t(this).hasClass("chaty-cta-close")){if(e=D(l,"c-widget"),t("#chaty-widget-"+l).find(".ch-pending-msg").remove(),e&&(O(l,"c-widget"),t(this).hasClass("chaty-cta-main"))){n=[],t("#chaty-widget-"+l+" .chaty-channel-list").find(".chaty-channel").each(function(){c=t(this).data("channel"),(e=D(l,"v-"+c))&&void 0!==c&&(O(l,"v-"+c),n.push(c))});var d=t("#chaty-widget-"+l).data("nonce");h||t.ajax({url:chaty_settings.ajax_url,data:{widgetId:l,userId:r,isMobile:s,channels:n,isSingle:0,nonce:d,action:"update_chaty_widget_click"},method:"post"})}t("#chaty-widget-"+l).hasClass("first_click")&&(t("#chaty-widget-"+l+" .chaty-cta-main").removeClass("active"),t("#chaty-widget-"+l+" .chaty-cta-main").removeClass("chaty-tooltip"))}else if(t(this).hasClass("single")){t("#chaty-widget-"+l).find(".ch-pending-msg").remove(),e=D(l,"c-widget");var d=t("#chaty-widget-"+l).data("nonce");e&&(O(l,"c-widget"),o=0,n=[],c=t(this).data("channel"),(e=D(l,"c-"+c))&&(n.push(c),o=1),h||t.ajax({url:chaty_settings.ajax_url,data:{widgetId:l,userId:r,isMobile:s,channels:n,isSingle:o,nonce:d,action:"update_chaty_widget_click"},method:"post"})),t("#chaty-widget-"+l).hasClass("first_click")&&(t("#chaty-widget-"+l+" .chaty-tooltip").removeClass("chaty-tooltip"),t("#chaty-widget-"+l+" .single-channel a").addClass("chaty-tooltip"))}else if(t(this).hasClass("chaty-channel")&&(c=t(this).data("channel"),e=D(l,"c-"+c))){O(l,"c-"+c);var d=t("#chaty-widget-"+l).data("nonce");h||t.ajax({url:chaty_settings.ajax_url,data:{widgetId:l,userId:r,isMobile:s,channel:c,nonce:d,action:"update_chaty_channel_click"},method:"post"})}}}),t(document).on("submit",".chaty-ajax-contact-form",function(a){a.preventDefault();var e=0;if(t(this).find(".has-chaty-error").each(function(){t(this).removeClass("has-chaty-error")}),t(this).find(".chaty-error-msg").remove(),t(this).find(".chaty-ajax-error-message").remove(),t(this).find(".chaty-ajax-success-message").remove(),t(this).find(".is-required").each(function(){""==jQuery.trim(t(this).val())&&(e++,t(this).addClass("has-chaty-error"))}),0==e){var c=t(this);t(".chaty-contact-submit-btn").attr("disabled",!0),jQuery.ajax({url:chaty_settings.ajax_url,data:{action:"chaty_front_form_save_data",name:c.find(".field-name").length?c.find(".field-name").val():"",email:c.find(".field-email").length?c.find(".field-email").val():"",phone:c.find(".field-phone").length?c.find(".field-phone").val():"",message:c.find(".field-message").length?c.find(".field-message").val():"",nonce:c.data("token"),channel:c.data("channel"),widget:c.data("index"),ref_url:window.location.href},type:"post",async:!0,defer:!0,success:function(a){if(a=jQuery.parseJSON(a),t(".chaty-ajax-error-message").remove(),t(".chaty-ajax-success-message").remove(),t(".chaty-contact-submit-btn").attr("disabled",!1),1==a.status)t(".chaty-contact-inputs").append("
"+a.message+"
"),t(".field-name, .field-email, .field-message, .field-phone").val(""),"yes"==a.redirect_action&&("yes"==a.link_in_new_tab?window.open(a.redirect_link,"_blank"):window.location=a.redirect_link),"yes"==a.close_form_after&&setTimeout(function(){if(t(".chaty-outer-forms.active").length){var a=t(".chaty-outer-forms.active").data("widget");(!T(a)||0==a)&&t("#chaty-widget-"+a).length&&(t("#chaty-widget-"+a).removeClass("form-open"),t(".chaty-outer-forms.active").removeClass("active"),t("#chaty-widget-"+a).find(".chaty-widget").hasClass("chaty-no-close-button")&&t("#chaty-widget-"+a).find(".chaty-widget").addClass("chaty-open"))}},1e3*parseInt(a.close_form_after_seconds));else if(1==a.error){if(a.errors.length)for(var e=0;e"+a.errors[e].message+"")}else t(".chaty-contact-inputs").append("
"+a.message+"
")}})}else t(".has-chaty-error:first").focus();return!1}),t(document).on("click",".chaty-widget.has-single .chaty-i-trigger .chaty-channel:not(.chaty-agent-button).Phone-channel",function(){window.location=t(this).find("a").prop("href")}),t(document).on("click",".chaty-widget.has-single .chaty-i-trigger .chaty-channel:not(.chaty-agent-button).Phone-channel a",function(t){t.stopPropagation(),t.stopImmediatePropagation()})}),t(window).resize(function(){t(window).height()>t(window).width()?t("body").addClass("cht-portrait").removeClass("cht-landscape"):t("body").addClass("cht-landscape").removeClass("cht-portrait")})});